/**
 * \file service.h
 * \author Davide Gessa
 * \date 10-12-09
 */
#ifndef SERVICE_H
#define SERVICE_H

#include <types.h>
#include <task/task.h>

#define SRV_OK		0
#define SRV_ER		1
#define SRV_DEP_ER	2
#define SRV_NF_ER	3


/**
 * Struttura di un servizio
 */
typedef struct service_p
{
	char name[128];						///< Nome del servizio
	uint8_t started;					///< Stato del servizio
	pid_t pid;							///< Processo associato
	struct service_p *next;				///< Puntatore al prossimo servizio
} service_t;


service_t *service_list;

uint8_t service_start(char *);
uint8_t service_stop(char *);
uint8_t service_create(char *);
uint8_t service_unload(char *);
service_t *service_get(char *);
char *service_get_x(int);

void srv_init();

#endif
